package org.pearl.app.feign;

import feign.Feign;
import feign.Logger;
import feign.Retryer;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by TD on 2021/12/24
 */
public class Psvm {

    public static void main(String[] args) {
/*        // 1. 生成Feign 客户端
        TestFeignClient feignClient = Feign.builder()
                .logger(new Logger.ErrorLogger()).logLevel(Logger.Level.FULL) // 打印所有日志
                .retryer(Retryer.NEVER_RETRY) // 关闭重启
                .target(TestFeignClient.class, "http://127.0.0.1:9001"); // 接口及请求地址
        // 2. 打印结果
        String test = feignClient.test("wang lihong");
        System.out.println(test);*/

        // 1. 生成Feign 客户端
        TestFeignClient feignClient = Feign.builder()
                .logger(new Logger.ErrorLogger()).logLevel(Logger.Level.FULL) // 打印所有日志
                .retryer(Retryer.NEVER_RETRY) // 关闭重启
                .target(TestFeignClient.class, "http://127.0.0.1:9001"); // 接口及请求地址
        // 2. 打印结果
        Map<String, String> params=new HashMap<>();
        params.put("name","bbb");
        User user=new User();
        user.setName("xiaozhuzhu");
        user.setAge(111);
        String test = feignClient.post(user);
        System.out.println(test);
    }
}
